<?php
/**
 * Created by JetBrains PhpStorm.
 * User: luca
 * Date: 11/06/13
 * Time: 15:06
 * To change this template use File | Settings | File Templates.
 */


add_filter('adleex_thread_field', 'adleex_thread_render_field', 10, 2);
function adleex_thread_render_field($field, $field_id) {
    global $post;

    switch ($post->post_status) {
        case 'draft':
        case 'pending':
        case 'publish':
            break;
        case 'closed':
            $field['readonly'] = true;
            break;
    }

    return $field;
}
